{% extends 'user/user_base.html' %}

{% block page_title %}用户登录{% endblock %}

{% block content_title %}用户登录{% endblock %}

{% block form %}
{#<form>#}
{#  <div class="form-group">#}
{#    <label for="exampleInputEmail1">Email address</label>#}
{#    <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email">#}
{#  </div>#}
{#  <div class="form-group">#}
{#    <label for="exampleInputPassword1">Password</label>#}
{#    <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">#}
{#  </div>#}
{#  <div class="form-group">#}
{#    <label for="exampleInputFile">File input</label>#}
{#    <input type="file" id="exampleInputFile">#}
{#    <p class="help-block">Example block-level help text here.</p>#}
{#  </div>#}
{#  <div class="checkbox">#}
{#    <label>#}
{#      <input type="checkbox"> Check me out#}
{#    </label>#}
{#  </div>#}
{#  <button type="submit" class="btn btn-default">Submit</button>#}
{#</form>#}


    <form action="" method="post">
     {% csrf_token %}
        <div class="form-group">
            {{ form.username.label_tag }}
            {{ form.username }}

            {% if form.username.errors %}
                {% for error in form.username.errors  %}
                    <p class="text-danger">{{ error }}</p>
                {% endfor %}
            {% endif %}
        </div>
        <div class="form-group">
            {{ form.password.label_tag }}
            {{ form.password }}
                  {% if form.password.errors %}
                {% for error in form.password.errors  %}
                    <p class="text-danger">{{ error }}</p>
                {% endfor %}
            {% endif %}
        </div>

        <button type="submit" class="btn btn-primary">登录</button>
        <a class="btn btn-secondary" href="{% url 'user:register' %}" role="button">没有账号，去注册</a>

    </form>

{% endblock %}